package com.gitee.ywj1352.bussiness.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;



@Component
public class OrderClient {

    @Autowired
    RestTemplate restTemplate;

    public String addOrder(Long userId){
        String url = "http://127.0.0.1:8085/order?userId=" + userId;
        try {
            restTemplate.getForEntity(url, Void.class);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException();
        }
        return "ok";
    }


}
